package org.example.pojo;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Plan extends Major {
    private int planno = 0;
    private String planname = "";
    private int semester = 0;
    private List<Integer> courses = new ArrayList<>();

    public Plan() { }

    public Plan(int departno, String name, int majorno, String majorname, int planno, String planname, int semester, List<Integer> courses) {
        super(departno, name, majorno, majorname);
        this.planno = planno;
        this.planname = planname;
        this.semester = semester;
        this.courses = courses;
    }

    public int getPlanno() {
        return planno;
    }

    public void setPlanno(int planno) {
        this.planno = planno;
    }

    public String getPlanname() {
        return planname;
    }

    public void setPlanname(String planname) {
        this.planname = planname;
    }

    public int getSemester() {
        return semester;
    }

    public void setSemester(int semester) {
        this.semester = semester;
    }

    public int getCourses(int i) {
        return courses.get(i);
    }//获取第i个课程的课程编号

    public void setCourses(int i,int course) {
        this.courses.add(i, course);
    }//设置第i个课程的课程编号

    public List<Integer> getCourses() { return courses; }

    public void setCourses(List<Integer> courses) { this.courses = courses; }

    @Override
    public String toString() {
        return "Plan{" +
                "planno=" + planno +
                ", planname='" + planname + '\'' +
                ", semester=" + semester +
                ", courses=" + courses +
                "} " + super.toString();
    }
}
